package com.javaxiaobear.module.system.domain;

import com.javaxiaobear.base.framework.aspectj.lang.annotation.Excel;
import com.javaxiaobear.base.framework.aspectj.lang.annotation.Excel.ColumnType;
import com.javaxiaobear.base.framework.web.domain.BaseEntity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 字典数据表 sys_dict_data
 *
 * @author javaxiaobear
 */
@EqualsAndHashCode(callSuper = true)
@Table(value = "sys_dict_data")
@Data
public class SysDictData extends BaseEntity {

  /** 字典编码 */
  @Id
  @Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
  private Long dictCode;

  /** 字典排序 */
  @Column(value = "dict_sort")
  @Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
  private Long dictSort;

  /** 字典标签 */
  @Column(value = "dict_label")
  @Excel(name = "字典标签")
  private String dictLabel;

  /** 字典键值 */
  @Column(value = "dict_value")
  @Excel(name = "字典键值")
  private String dictValue;

  /** 字典类型 */
  @Column(value = "dict_type")
  @Excel(name = "字典类型")
  private String dictType;

  /** 样式属性（其他样式扩展） */
  @Column(value = "css_class")
  private String cssClass;

  /** 表格字典样式 */
  @Column(value = "list_class")
  private String listClass;

  /** 是否默认（Y是 N否） */
  @Column(value = "is_default")
  @Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
  private String isDefault;

  /** 状态（0正常 1停用） */
  @Column(value = "status")
  @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
  private String status;

  @NotBlank(message = "字典标签不能为空")
  @Size(max = 100, message = "字典标签长度不能超过100个字符")
  public String getDictLabel() {
    return dictLabel;
  }

  @NotBlank(message = "字典键值不能为空")
  @Size(max = 100, message = "字典键值长度不能超过100个字符")
  public String getDictValue() {
    return dictValue;
  }

  @NotBlank(message = "字典类型不能为空")
  @Size(max = 100, message = "字典类型长度不能超过100个字符")
  public String getDictType() {
    return dictType;
  }

  @Size(max = 100, message = "样式属性长度不能超过100个字符")
  public String getCssClass() {
    return cssClass;
  }
}
